package com.cskaoyan.bean.usersadmin;

import com.cskaoyan.bean.po.MarketAddress;
import lombok.Data;

import java.util.List;

/**
 * ClassName: AddressData
 * Description:
 * date: 2022/6/5 15:43
 *
 * @author bruce
 * @since JDK 8
 */
@Data
public class AddressData {

    /**
     * total : 1
     * pages : 1
     * limit : 20
     * page : 1
     * list : [{"id":73,"name":"caoxu ","userId":1,"province":"天津市","city":"市辖区","county":"和平区","addressDetail":"sasa","areaCode":"120101","tel":"12776111711","isDefault":false,"addTime":"2022-05-11 16:34:12","updateTime":"2022-05-11 16:34:12","deleted":false}]
     */
    private Integer total;
    private Integer pages;
    private Integer limit;
    private Integer page;
    private List<MarketAddress> list;

    public static AddressData data(long total, int pages, int limit, int page, List<MarketAddress> list) {
        AddressData addressData = new AddressData();
        addressData.setTotal((int) total);
        addressData.setPages(pages);
        addressData.setLimit(limit);
        addressData.setPage(page);
        addressData.setList(list);
        return addressData;
    }
}
